package org.xxx.epms.gateway.feign;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.xxx.epms.gateway.dto.AdminDetailsDto;
import org.xxx.epms.gateway.dto.AdminPermissionDto;
import org.xxx.epms.gateway.feign.handler.AdminFeignHandler;

import java.util.List;

@FeignClient(value = "epms-admin",fallback = AdminFeignHandler.class)
@Component
public interface AdminFeign {

    @RequestMapping(value = "/admin/getAdminDetails", method = RequestMethod.GET)
    AdminDetailsDto getAdminDetails(@RequestParam("adminCode") String adminCode);

    @GetMapping("/admin/getAdminPermissionList")
    List<AdminPermissionDto> getAdminPermissionList();

}